package qc;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Vector;

import org.quickconnect.ControlObject;

import ui.MainFrame;

import beans.CommunicationBean;

import com.mysql.jdbc.Connection;

import controller.ServerConnectionHandler;

public class SendMuteRoomBCO implements ControlObject 
{
	@Override
	public Object handleIt(ArrayList<Object> arg0) {
		HashMap params = (HashMap) arg0.get(arg0.size()-1);
		Connection con = (Connection) MainFrame.mainFrame.getController().getConnectionPool().getConnection();

		if((Boolean)params.get("roomMuted"))
		{
			params.put("serverNotification", "Session is muted.");
		}
		else
		{
			params.put("serverNotification", "Session is no longer muted.");
		}
		
		CommunicationBean bean = new CommunicationBean();
		bean.setCommand("muteRoomResponse");
		HashMap parameters = new HashMap();
		parameters.put("roomMuted", params.get("roomMuted"));
		parameters.put("sessionId", (String) params.get("sessionId"));
		bean.setParameters(parameters);
		params.put("commBean", bean);
		return params;
	}

}
